package cn.hf.mychat.Study;

import cn.hf.mychat.utils.StringUtils;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class URLEncoders {
    public static void main(String[] args) {
       /* String s = "https://www.baidu.com/s?wd=见鬼";
        String Url = StringUtils.encodeUrl(s, "UTF-8");
        System.out.println("s1 = " + s);
        try {
            String encode = URLEncoder.encode(s,"UTF-8");
            System.out.println("encode = " + encode);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }*/
     String s = "2019-11-06 16:28:56.0";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            Date parse = simpleDateFormat.parse(s);
            String format = simpleDateFormat.format(parse);
            System.out.println("format = " + format);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
